//
//  UIView+ZQExtension.m
//  柳州微博
//
//  Created by Apple_Lzzy40 on 16/9/19.
//  Copyright © 2016年 Apple_Lzzy40. All rights reserved.
//

#import "UIView+ZQExtension.h"

@implementation UIView (ZQExtension)


-(CGFloat)x
{

    return  self.frame.origin.x;
}
-(void)setX:(CGFloat)x
{
    CGRect currentFrame=self.frame;
    
    currentFrame.origin.x=x;
    
    self.frame=currentFrame;
}


-(CGFloat)y
{
    return self.frame.origin.y;
    
}

-(void)setY:(CGFloat)y
{
    CGRect currentFrame=self.frame;
    
    currentFrame.origin.y=y;
    
    self.frame=currentFrame;
}
-(void)setCenterX:(CGFloat)centerX
{
    CGPoint centr=self.center;
    
    centr.x=centerX;
    
    self.center=centr;
}
-(CGFloat)centerX
{
    return self.center.x;
}
-(void)setCenterY:(CGFloat)centerY
{
    CGPoint centr=self.center;
    
    centr.x=centerY;
    
    self.center=centr;
}
-(CGFloat)centerY
{
    return self.center.y;
}

-(CGFloat)width
{
    return self.frame.size.width;
    
}

-(void)setWidth:(CGFloat)width
{
    CGRect currentFrame=self.frame;
    
    currentFrame.size.width=width;
    
    self.frame=currentFrame;
}

-(CGFloat)height
{
    return self.frame.size.height;
    
}

-(void)setHeight:(CGFloat)height
{
    CGRect currentFrame=self.frame;
    
    currentFrame.size.height=height;
    
    self.frame=currentFrame;
}

-(CGPoint)origin
{
    return self.frame.origin;
    
}

-(void)setOrigin:(CGPoint)origin
{
    CGRect currentFrame=self.frame;
    
    currentFrame.origin=origin;
    
    self.frame=currentFrame;
}




-(void)setSize:(CGSize)size
{
    //1.取出矩形尺寸
    CGRect currentFrame =self.frame;
    //2.尺寸赋值
    currentFrame.size=size;
    //3.框架赋值
   self.frame=currentFrame;
    

     
}

-(CGSize)size
{

    return self.frame.size;
}


@end
